package com.sz.sensor.module.platform.presenter;

import android.os.Handler;
import android.os.Looper;

import com.sz.framework.mvp.BasePresenter;
import com.sz.sensor.R;
import com.sz.sensor.entity.SimpleEntity;
import com.sz.sensor.module.platform.MsgActivity;

import java.util.ArrayList;
import java.util.List;

public class MsgPresenter extends BasePresenter<MsgActivity>{
    public void getMsgData() {
        viewer.showLoadingDialog();
        new Handler(Looper.getMainLooper()).postDelayed(() -> {
            viewer.cancelLoadingDialog();
            List<SimpleEntity> entities = new ArrayList<>();
            // 打卡
            SimpleEntity entity1 = new SimpleEntity();
            entity1.setImgId(R.drawable.icon_punch);
            entity1.setTitle("打卡");
            entity1.setSubTitle("16:22上班人脸打卡·迟到");
            entity1.setDate("16:22");
            entities.add(entity1);
            // 小微客服
            SimpleEntity entity2 = new SimpleEntity();
            entity2.setImgId(R.drawable.icon_service);
            entity2.setTitle("小微客服");
            entity2.setSubTitle("经过7天的共同成长，相信你们公司已经…");
            entity2.setDate("星期三");
            entities.add(entity2);
            // 小微团队
            SimpleEntity entity3 = new SimpleEntity();
            entity3.setImgId(R.drawable.icon_team);
            entity3.setTitle("小微团队");
            entity3.setSubTitle("16:22上班人脸打卡·迟到");
            entity3.setDate("星期二");
            entities.add(entity3);
            // 微邮
            SimpleEntity entity4 = new SimpleEntity();
            entity4.setImgId(R.drawable.icon_email);
            entity4.setTitle("微邮");
            entity4.setSubTitle("邮件来了");
            entity4.setDate("星期一");
            entities.add(entity4);
            // 聊天
            SimpleEntity entity5 = new SimpleEntity();
            entity5.setImgId(R.drawable.icon_sample);
            entity5.setTitle("张三");
            entity5.setSubTitle("你好，我是张三");
            entity5.setDate("星期一");
            entities.add(entity5);

            viewer.onGetMsgData(entities);
        }, 1000);
    }
}
